<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>入场须知</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../css/common.css" />
		<style>
			.signform{
        padding: 20px 0;
      }
      .signform .btn{
        padding: 15px 0;
        width: 100%;
        display: inline-block;
        text-align: center;
        border-radius: 6px;
      }
      .signform img{
        width: 6.25rem;
		/*
        transform:rotate(-90deg);
        -moz-transform:rotate(-90deg);
        -webkit-transform:rotate(-90deg);
		*/
      }
      .signform .border-bottom{
        border-bottom: 1px solid #dcdcdc;
      }	
	  .padding{
		  padding:0.94rem 8%
	  }
	  body{background:#fff;}
	  ul,li{list-style: none;width:100%;padding:0;}
	  li{font-size:14px;color:#8f8f94;padding:0;}
	  p{display: block;}
	  
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">入场登记须知</h1>
		</header>
		<div style="width: 100%;height:5vh;"></div>
		
    <div class="mui-content bg-white padding-bottom" id="page">
		<div style="width: 86%;margin:0 7%;text-align:center;height:50px;line-height: 40px;
		border-bottom:1px dashed #ABAAAA">外来人员入场登记须知</div>
      <div class="padding signform" v-html="html">
       
	  </div>
	  
		<div id="video" style="width:100%; height: 200px; margin:auto; position: absolute;top:0;"></div>
	  
	</div>
    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="../../../js/vue.js"></script>
	<script src="../js/mkeyplus.base.js"></script>
	<script src="../formal/js/api.js"></script>
    <script>
		
	  var htapi = new HTGlobal();
      mui.init()
      var page = new Vue({
			  el: '#page',
			  data:{
				  html:''
			  }
	  });  
	  
	  var load = function(){
		var user = localStorage.getItem('outUser')
		if(user){
				//console.log(user);
				//return;
					 user = JSON.parse(user);
					 htapi.fetch({appUserId:user.id,projectId:user.currentProjectId,
					 enterpriseProjectId:user.enterpriseProjectId},function(data){
						if(data.code=='0'){
							var _data = data.data;
							var cont = _data.pactContent;
							if(!_data.id){
								mui.openWindow({
								  url: '../formal/registration_on.html',
								  id: '../formal/registration_on.html',
								  show:{
									  aniShow:'none'
								  },
								  waiting:{
									  autoShow:false
								  }
								});
								return;
							}
							console.log(JSON.stringify(_data));
							console.log(htapi.filePath+_data.signatureId);
							cont = cont.replace('{#username#}',user.compellation+'<br>'+
										'<img style="width:8%" id="loadtu" src="../sign/loading.gif" /><img width="30%" onload="imgload()" src="'+htapi.filePath+_data.signatureId+'?token='+localStorage.getItem('token')+'"/><br>')
							cont = cont.replace('{#signature#}','');
							cont = cont.replace('{#company#}',user.hasUnit==0?'无工作单位':(user.enterpriseName||''))
							cont = cont.replace('{#content#}',_data.content||'')
							cont = cont.replace('{#areaName#}',_data.areaName)
							cont = cont.replace('{#stationName#}',_data.stationName)
							cont = cont.replace('{#phone#}',_data.phone)
							cont = cont.replace('{#date#}',_data.approachTime)
							page.html = cont;
						}
					 },'加载中','findAdmissionNotice','post')
		}  
	  }
	  window.addEventListener("update", function(e) {
		  load();
	  });
	  
      mui.plusReady(function(){
		 load();
	  })

	  var imgload = function(){
		  var tu = $('#loadtu');
		  tu.remove();
	  }
    </script>
</body>
</html>